package branch.feature.about_page

import android.widget.ImageView
import android.widget.TextView
import com.drakeet.about.AbsAboutActivity
import com.drakeet.about.Card
import com.drakeet.about.Category
import com.drakeet.about.Contributor
import com.drakeet.about.License
import com.example.mynewsapp.BuildConfig
import com.example.mynewsapp.R

class AboutPageActivity : AbsAboutActivity() {
    // ref link: https://github.com/PureWriter/about-page
    override fun onCreateHeader(icon: ImageView, slogan: TextView, version: TextView) {
        icon.setImageResource(R.mipmap.ic_launcher)
        slogan.text = "About Page By eeppee_admin"
        version.text = "v" + BuildConfig.VERSION_NAME
    }

    override fun onItemsCreated(items: MutableList<Any>) {
        items.add(Category("介绍与帮助"))
        items.add(Card("给我一个介绍本应用的描述"));


        items.add(Category("Developers"));
        items.add(
            Contributor(
                R.drawable.ic_baseline_person,
                "drakeet",
                "Developer & designer",
                "http://weibo.com/drak11t"
            )
        );
        items.add(
            Contributor(
                R.drawable.ic_baseline_person,
                "黑猫酱",
                "Developer",
                "https://drakeet.me"
            )
        );
        items.add(Contributor(R.drawable.ic_baseline_person, "小艾大人", "Developer"));

        items.add(Category("Open Source Licenses"));
        items.add(
            License(
                "MultiType",
                "drakeet",
                License.APACHE_2,
                "https://github.com/drakeet/MultiType"
            )
        );
        items.add(
            License(
                "about-page",
                "drakeet",
                License.APACHE_2,
                "https://github.com/drakeet/about-page"
            )
        );
    }
}
